package com.microservices.cloud.controller;

import com.microservices.cloud.entities.CommonResult;
import com.microservices.cloud.entities.Payment;
import com.microservices.cloud.service.PaymentFeignService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/pay")
@CrossOrigin
@Slf4j
public class OrderFeignController {


    @Resource
    private PaymentFeignService paymentFeignService;


    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id) {
        return paymentFeignService.getPaymentById(id);
    }

    @GetMapping(value = "/consumer/payment/feign/timeout")
    public String feignTimeOut() {
        return paymentFeignService.feignTimeOut();
    }


}
